﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class NoItm_RunState : IPlayerState
{
  //  private Animator animator = GameObject.FindGameObjectWithTag("Player").GetComponent<Animator>();
    float axisSpeed;

    public NoItm_RunState()
    {
        stateID = StateID.WalkID;
    }

    public override void Act(GameObject player)
    {
        animator.SetFloat("MovSpeed", axisSpeed);
    }

    public override void Reason(GameObject player)
    {

        if ((Mathf.Abs(ETCInput.GetAxisSpeed("Vertical")) > (Mathf.Abs(ETCInput.GetAxisSpeed("Horizontal")))))
        {
            axisSpeed = Mathf.Abs(ETCInput.GetAxisSpeed("Vertical"));
        }
        else
        {
            axisSpeed = Mathf.Abs(ETCInput.GetAxisSpeed("Horizontal"));
        }


        if (axisSpeed < 0.4f)
        {
            player.GetComponent<PlayerControl>().SetTransition(Transition.IsWalk);
        }
    }
}
